<template xmlns:v-on="http://www.w3.org/1999/xhtml">
  <div class="content">
    <div class="content-center">
      <!-- 头部 -->
      <div class="main-title">
        <h2>添加模板</h2>
      </div>
      <!--筛选-->
      <!-- <div class="main-search">
      </div> -->
      <!--列表-->
      <div class="main-list">
        <div class="list-two">
          <div class="list-two-list">
            <div>标题</div>
            <div>
              <input type="text">           
            </div>
          </div>
          <div class="list-two-list">
            <div>类型</div>
            <div>
              <select @change="selectTypesClick" v-model="type">
                <option v-for="(type,index) in types" v-bind:value="index" :key="index">{{type.name}}</option>
              </select>             
            </div>
          </div>
        </div>
        <div class="list-two">
          <div class="list-two-list">
            <div>主题</div>
            <div>
              <input type="text">          
            </div>
          </div>
          <div class="list-two-list">
            <div>编辑人</div>
            <div>
              <input type="text">          
            </div>
          </div>
        </div>
        <div class="list-text">
          <div>内容</div>
          <div>
            <textarea></textarea>                
          </div>
        </div>
        <div class="list-button">
          <div class="button-save">
            保存
          </div>
          <div class="button-cancel">
            取消
          </div>
        </div>
      </div>
      <div :class="{showdel:isShowdel}" class="delPopup">
        <transition name="slide-fade">
          <div class="delContent">
            <v-mIntercept @ok="confirmClick" @canle="cancelClick" :name="titlename"></v-mIntercept>
          </div>
        </transition>
      </div>
    </div>
  </div>
</template>
<script>
import { mapActions } from "vuex";
import mIntercept from "../module/mIntercept";
export default {
  components: {
    "v-mIntercept": mIntercept
  },
  data() {
    return {
      type: "0",
      types: [{ name: "全部标签" }, { name: "标签1" }],
      isShowdel: true,
      intercept: false,
      toPath: "",
      titlename: "劳动成果还未保存，是否退出？",
      pageSizeNum: 10,
      currentPage: 1,
      totalNum: 1000
    };
  },
  // 过滤
  filters: {
    timeFun: function(val) {
      var now = new Date(val);
      var year = now.getYear() - 100;
      var month = now.getMonth() + 1;
      month = month > 9 ? month : "0 " + month;
      var date = now.getDate();
      date = date > 9 ? date : "0 " + date;
      var hour = now.getHours();
      hour = hour > 9 ? hour : "0 " + hour;
      var minute = now.getMinutes();
      minute = minute > 9 ? minute : "0 " + minute;
      return (
        "20 " + year + "- " + month + "- " + date + " " + hour + ": " + minute
      );
    }
  },
  // 模块新建时
  created: function() {
    var self = this;
  },
  // 计算属性
  mounted() {},
  // 事件处理
  methods: {
    // 获取列表
    listFun() {
      var self = this;
      self
        .getstoreclassAttributefindPage({})
        .then(data => {
          if (data.code == 200) {
          } else {
          }
        })
        .catch(msg => {});
    },
    selectTypesClick() {},
    confirmClick() {
      this.intercept = true;
      var url = this.toPath;
      this.$router.push({
        path: url
      });
    },
    //取消未保存弹出框
    cancelClick() {
      this.isShowdel = true;
    },
    ...mapActions([""])
  },
  // 监视
  watch: {}
};
</script>
<style scoped>
.button-save {
  margin-left: 160px;
  width: 110px;
  height: 28px;
  border-radius: 4px;
  background-color: #fe966d;
  text-align: center;
  line-height: 28px;
  color: #fff;
  cursor: pointer;
}
.button-cancel {
  cursor: pointer;
  margin-left: 30px;
  width: 110px;
  text-align: center;
  line-height: 28px;
  height: 28px;
  border-radius: 4px;
  background-color: #d1d2d2;
  color: #fff;
}

.list-button {
  margin-top: 18px;
  width: 500px;
  display: flex;
}
.list-file-r-file label {
  border-radius: 4px;
  min-width: 120px;
  height: 30px;
  background-color: #2fa89e;
  display: flex;
  align-items: center;
  justify-content: space-around;
  font-size: 14px;
  color: #fff;
  cursor: pointer;
}
.list-file-r-file label img {
  width: 20px;
  height: 20px;
}
.list-file-r-file input {
  opacity: 0;
}
.list-file-r-file {
  min-width: 110px;
  height: 28px;
  margin-left: 25px;
  display: flex;
}
.list-file-r-img {
  width: 110px;
  height: 50px;
  border: 1px solid #ccc;
}
.list-file-right {
  width: 500px;
  height: 50px;
  margin-left: 15px;
  display: flex;
  align-items: center;
}
.list-file {
  display: flex;
  height: 70px;
  margin-top: 18px;
  width: 100%;
}

.list-file > div:nth-child(1) {
  width: 150px;
  font-size: 15px;
  font-weight: 600;
  color: #666;
  text-align: right;
}
.list-text {
  display: flex;
  height: 70px;
  width: 100%;
}

.list-text > div:nth-child(1) {
  width: 150px;
  font-size: 15px;
  font-weight: 600;
  color: #666;
  text-align: right;
}
.list-text > div:nth-child(2) textarea {
  width: 560px;
  resize: none;
  height: 65px;
  border: 1px solid #ccc;
  border-radius: 4px;
}
.list-text > div:nth-child(2) {
  margin-left: 15px;
  min-width: 540px;
  height: 65px;
}
.list-two-list {
  display: flex;
  align-items: center;
}
.list-two-list > div:nth-child(1) {
  width: 150px;
  font-size: 15px;
  font-weight: 600;
  color: #666;
  text-align: right;
}
.list-two-list > div:nth-child(2) {
  margin-left: 15px;
}
.list-two {
  display: flex;
  align-items: center;
  margin-bottom: 18px;
}
select,
input {
  width: 200px;
  height: 30px;
  border-radius: 4px;
  font-size: #666;
  border: 1px solid #9c9c9c;
}
select::-ms-expand,
select::-webkit-expand {
  display: none;
}
.main-list > div {
  width: 100%;
  min-height: 32px;
}
.main-list {
  width: 100%;
  margin-top: 15px;
  min-height: 50px;
  background-color: #ffff;
  min-height: 500px;
}

.main-title h2 {
  height: 100%;
  margin-left: 8px;
  font-size: 16px;
  font-weight: 600;
  color: #666;
}
.main-title {
  margin-left: 10px;
  width: 100%;
  height: 55px;
  background-color: #fff;
  line-height: 55px;
  overflow: hidden;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.content {
  overflow: hidden;
  min-height: 500px;
}

.content-center {
  overflow: hidden;
  width: calc(100% - 20px);
  margin-left: 10px;
  background-color: #fff;
  margin-top: 33px;
  border-radius: 3px;
}

/*取消弹出框*/

.delPopup {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0);
  z-index: 1000000;
}

.showdel {
  display: none;
}

.delContent {
  width: 525px;
  height: 280px;
  background-color: #fff;
  border: 1px solid #eaeaea;
  box-shadow: 0px 10px 10px #eaeaea;
  border-radius: 7px;
  margin: calc((100vh - 280px) / 2) auto;
  z-index: 100000;
}

.slide-fade-enter-active {
  transition: all 0.7s ease;
}

.slide-fade-enter,
.slide-fade-leave-active {
  transform: translateY(-30px);
  opacity: 0;
}
</style>